import QtQuick 2.0
import QtQuick.Layouts 1.1

Item {
    id:workClickImg
    signal clicked();
    property string img_source: ""
    property string textlabel: ""
    property Component toComponent //要跳转的组件

    ColumnLayout{
        anchors.fill:parent
        Rectangle{
            Layout.alignment: Qt.AlignCenter
            Layout.preferredWidth: 45
            Layout.preferredHeight: 45
            color:"#f3f3f3"
            radius: 5
            BorderImage{
                source:img_source
                anchors.fill: parent
            }
        }
        Text{
            Layout.alignment: Qt.AlignCenter
            Layout.preferredWidth: 45
            Layout.preferredHeight: 20
            text:textlabel
            fontSizeMode: Text.FixedSize

            horizontalAlignment : Text.AlignHCenter

            font{
                family:"迷你简汉真光标"
                pixelSize: 8
            }
        }
    }
    MouseArea{
        anchors.fill:parent
        onClicked: {
            workClickImg.clicked();
        }
    }
}
